// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//

#pragma once

#include <nebula/types/fundamental.h>

namespace nebula {

    /// Concrete type class for always-null data
    class TURBO_EXPORT NullType : public DataType {
    public:
        static constexpr Type::type type_id = Type::NA;

        static constexpr const char *type_name() { return "null"; }

        NullType() : DataType(Type::NA) {}

        std::string to_string(bool show_metadata = false) const override;

        DataTypeLayout layout() const override {
            return DataTypeLayout({DataTypeLayout::AlwaysNull()});
        }

        std::string name() const override { return "null"; }

    protected:
        std::string compute_fingerprint() const override;
    };
} // namespace nebula
